package com.link.gateway.core.utils;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

/**
 * 邮件通知实现类
 *
 * @author 李杨
 * @date 2019/12/26
 */
public class EmailUtil {

    public static void sendEmail(String mailSubject, String content, String[] addressee) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setTo(addressee);
        message.setSubject(mailSubject);
        message.setText(content);
        //这里暂时写死，后面改成配置
        message.setFrom(YmlConstants.getEmailFrom());
        MailSender mailSender = (MailSender) BeanTools.getBean("mailSender");
        //发送邮件
        mailSender.send(message);
    }
}
